using System;
using System.Runtime.InteropServices.JavaScript;
using System.Runtime.Versioning;

[assembly: SupportedOSPlatform("browser")]

namespace ConsoleApp1
{
    public static partial class Calculator
    {
        private const int DecimalPlaces = 10;

        [JSExport]
        public static double Add(double a, double b)
        {
            Console.WriteLine($"Add called with {a} and {b}");
            decimal result = Convert.ToDecimal(a) + Convert.ToDecimal(b);
            result = Math.Round(result, DecimalPlaces);
            return Convert.ToDouble(result);
        }
        [JSExport]
        public static void SetRedBackground(JSObject divElement)
        {
            divElement.SetProperty("style", "width:100px;height:100px;background-color: red");
        }
        public static void Main()
        {
            // Entry point required for compilation
        }
    }
}